﻿#region Copyright(C) 2013-2013 NCS Pte. Ltd. All rights reserved.
// ==================================================================================================
// Copyright(C) 2010 NCS Pte. Ltd. All rights reserved.
//
// SYSTEM NAME      : iConnect .Net Application Framework
// COMPONENT ID     : NCS.IConnect.Core.EntLib
// COMPONENT DESC   : Microsoft Enterprise Library Adapter.
//
// CREATED DATE/BY  : 18 Dec 2013 / Jiang Jin Nan
//
// REVISION HISTORY :
// DATE/BY            SR#/CS/PM#/OTHERS       DESCRIPTION OF CHANGE
// ==================================================================================================
#endregion

using Microsoft.Practices.Unity.Configuration;
using Microsoft.Practices.Unity.Configuration.ConfigurationHelpers;
using System.Configuration;

namespace NCS.IConnect.Core.IoC.Configuration
{
    /// <summary>
    /// The interceptor based configuration element.
    /// </summary>
    public class AutoInterceptorElement : DeserializableConfigurationElement
    {
        private const string typeProperty = "type";

        /// <summary>
        /// Gets the injection.
        /// </summary>
        [ConfigurationProperty("", IsDefaultCollection = true)]
        public InjectionMemberElementCollection Injection
        {
            get { return (InjectionMemberElementCollection)this[""]; }
        }

        /// <summary>
        /// Gets or sets the name of the type.
        /// </summary>
        /// <value>
        /// The name of the type.
        /// </value>
        [ConfigurationProperty(typeProperty, IsRequired = true)]      
        public string TypeName
        {
            get { return (string)this[typeProperty]; }
            set { this[typeProperty] =  value;}
        }
    }
}
